package com.kangfu.api.service.impl;

import java.util.List;

import com.kangfu.api.service.IUserPointService;
import com.kangfu.db.domain.entity.UserPoint;
import com.kangfu.db.mapper.UserPointMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


/**
 * 用户运动打分Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-09-30
 */
@Service
public class UserPointServiceImpl implements IUserPointService
{
    @Autowired
    private UserPointMapper userPointMapper;

    @Override
    public UserPoint getUserPointByPage(Integer userId, Integer page) {
        int offset = page - 1;
        if (offset < 0) {
            offset = 0;
        }
        UserPoint userPoint = userPointMapper.getUserPointByPage(userId, page);
        return userPoint;
    }

    @Override
    public Integer getCountByUserId(Integer userId) {
        return userPointMapper.getCount(userId);
    }

}
